package thread;

public class ThreadDemo1 {
    public static void main(String[] args) {
        Thread a1 = new MyThread1();
        Thread a2 = new MyThread2();
        a1.start();
        a2.start();
    }
}

class MyThread1 extends Thread{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是谁啊？");
        }
    }
}

class MyThread2 extends Thread{
    public void run(){
        for (int i = 0; i < 1000; i++) {
            System.out.println("开门，查水表的！");
        }
    }
}